package cn.itsource.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

public class PhoneConfig {

    /**
     * 创建 WechatConfig实体类用来存值 对象用来读取yaml中的微信的配置
     */
    @Data
    @Component
    @ConfigurationProperties(prefix = "wechat") //需要用该注解来读取yaml配置项 如在yaml文件中wechat: appid
    public static class WechatConfig {
        private String appid;
        private String secret;
        public static String WECHAT_URL =
                "https://api.weixin.qq.com/sns/jscode2session?appid=%s&secret=%s&js_code=%s&grant_type=authorization_code";

    }
}
